.view {
  position: relative;
  float: left;
  min-width: 100%;
  width: calc(var(--view-width) + var(--sticky-width));
  height: var(--view-height);
  background: var(--view-bg);
  padding-bottom: 96px;

  --view-width: 1960px;
  --view-height: 300px;
  --sticky-width: 240px;
  --edge-padding: 10px;

  --now-offset: 980px;

  @mixin dark {
    --view-line-color: var(--mantine-color-gray-6);
    --view-bg: var(--mantine-color-gray-7);
    --accent-color: var(--mantine-primary-color-7);
    --striation-color: var(--mantine-color-gray-8);
    --point-color: var(--mantine-color-dark-0);
  }

  @mixin light {
    --view-line-color: var(--mantine-color-light-6);
    --view-bg: var(--mantine-color-light-1);
    --accent-color: var(--mantine-primary-color-7);
    --striation-color: darken(var(--mantine-color-light-2), 5%);
    --point-color: white;
  }
}

/* data container */

.dataPos {
  position: absolute;
  width: calc(var(--view-width) + var(--sticky-width));
  z-index: 0;
  height: 0;
  top: 68px;
}

.dataRow {
  display: flex;
  height: 33px;
  width: 100%;
  z-index: 85;
  isolation: auto;
  overflow: visible;
}

.dataRect {
  display: flex;
  height: 30px;
  z-index: 85;
  margin-top: 1px;
  margin-bottom: 1px;

  &::hover {
    cursor: pointer;
    background: var(--mantine-primary-color-7);
  }
}

.dataItem {
  left: var(--left);
  width: var(--width);
  position: absolute;

  border-radius: 6px;
  background: var(--color);
  box-shadow:
    rgba(15, 15, 15, 0.2) 0px 0px 0px 1px,
    rgba(15, 15, 15, 0.2) 0px 2px 4px;

  &[data-rov] {
    border-right: none;
    border-radius: 6px 0 0 6px;

    & > * {
      border-right: none;
      border-radius: 6px 0 0 6px;
    }
  }
}

.dataText {
  --text-lh: 30px;
  --text-fz: var(--mantine-font-size-sm);
  --text-color: var(--mantine-color-default-color);

  padding: 0 4px;
  max-width: 300px;
  pointer-events: none;
  user-select: none;
  overflow: hidden;

  & > p {
    z-index: 100;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }

  &[data-state='b'] {
    position: absolute;
    left: var(--left);
  }

  &[data-state='i'] {
    position: sticky;
    left: calc(var(--sticky-width) + var(--edge-padding));
  }

  &[data-state='a'] {
    position: absolute;
    left: var(--right);
  }
}

.dataLink {
  display: flex;
  color: inherit;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border-radius: 6px;

  transition: background 50ms ease-in;

  @mixin hover {
    @mixin light {
      background: rgba(55, 53, 47, 0.065);
      box-shadow: 0 0 2px var(--mantine-color-gray-2);
    }

    @mixin dark {
      background: rgba(255, 255, 255, 0.075);
      box-shadow: 0 0 2px var(--mantine-color-gray-7);
    }
  }
}

/* end data container */

/* date container */

.datePos {
  position: absolute;
  left: 0px;
  top: 0px;
  padding-left: var(--sticky-width);
  width: calc(var(--view-width) + var(--sticky-width));
  background: var(--view-bg);
  box-sizing: border-box;
  box-shadow: inset 0 var(--timeline-box-shadow, 1px) 0 0 var(--view-line-color);
}

.days {
  position: relative;
  overflow: hidden;
  cursor: default;
  text-align: center;
  height: 32px;

  box-shadow: var(--view-line-color) 0px -1px 0px 0px inset;
}

.months {
  position: relative;
  overflow: hidden;
  cursor: default;
  text-align: center;
  height: 36px;
}

.date {
  position: absolute;
  top: 0px;
  width: 40px;
  display: flex;
  align-items: center;
}

.day {
  height: 28px;
  line-height: 28px;

  --text-fz: var(--mantine-font-size-xs);
  color: var(--mantine-color-dimmed);
}

.today {
  position: relative;

  & > span {
    position: relative;
    color: white;
    font-weight: 700;
  }

  &::before {
    content: '';
    background: var(--accent-color);
    width: 22px;
    height: 22px;
    border-radius: 11px;
    position: absolute;
    left: calc(50% - 11px);
    top: calc(50% - 11px);
    margin-top: 1px;
  }
}

.nowPoint {
  position: absolute;
  left: var(--now-offset);
  top: 62px;
  width: 11px;
  height: 11px;
  background: var(--accent-color);
  border-radius: 100%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--point-color);

  &::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 10px;
    width: 0px;
    height: calc(var(--view-height) - 68px);
    border-right: 3px dashed var(--accent-color);
    border-radius: 0%;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));
  }
}

.month {
  height: 32px;
  width: 80px;
  line-height: 32px;
  text-align: left;

  vertical-align: middle;
  padding-top: 8px;

  --text-fz: var(--mantine-font-size-sm);
}

.center {
  margin: 0 auto;
}

.left {
  margin-left: 8px;
}

.label {
  font-weight: 500;
}

.nowPos {
  position: sticky;
  top: 1px;
  left: 0px;
  width: var(--sticky-width);
  z-index: 16;
  height: 0px;
}

.nowBox {
  position: absolute;
  padding-left: var(--sticky-width);
  display: flex;
  align-items: center;
  height: 36px;
  padding-top: 6px;
  margin-left: 0.5rem;
  width: fit-content;
  background: var(--view-bg);

  & > p {
    white-space: nowrap;
  }
}

.fadeBox {
  width: 30px;
  margin-right: -30px;
  height: 100%;
  background: linear-gradient(to right, var(--view-bg) 20%, transparent 100%);
}

/* end date container */

/* title container */

.titlePos {
  position: sticky;
  left: 0px;
  height: 0px;
  width: var(--sticky-width);
  z-index: 100;
}

.titleBox {
  white-space: nowrap;
  text-align: right;
  background: var(--view-bg);
  box-sizing: border-box;
  border-right: 1px solid var(--view-line-color);
  box-shadow: var(--mantine-shadow-sm);
  clip-path: polygon(0% 0%, 120% 0%, 120% 100%, 0% 100%);
  width: var(--sticky-width);
  height: var(--view-height);
}

.titleHeader {
  height: 68px;
  border-style: solid none solid none;
  border-width: 1px;
  border-color: var(--view-line-color);
}

.titleRow {
  display: flex;
  width: var(--sticky-width);
  height: 33px;
  overflow-x: clip;

  border-bottom: 1px solid var(--view-line-color);
}

.title {
  user-select: none;
  text-align: left;
  transition: background 20ms ease-in;
  cursor: pointer;
  position: relative;
  display: block;
  overflow: clip;
  white-space: nowrap;
  height: 32px;
  min-height: 32px;
  padding: 5px 8px;
  font-weight: 500;
}

/* end title table */

/* background */

.background {
  position: absolute;
  width: calc(var(--view-width) + var(--sticky-width));
  height: 100%;
  overflow: hidden;
  cursor: default;
  padding-left: var(--sticky-width);
}

.weekends {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: default;
  height: var(--view-height);
}

.weekend {
  position: absolute;
  height: 100%;
  width: 80px;
  background: var(--striation-color);
}

/* end background background */

.gameBox {
  width: 100%;
  padding-right: 8px;
  flex-wrap: nowrap;
  gap: var(--mantine-space-xs);
  justify-content: space-between;

  &:hover {
    cursor: pointer;
    background: light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.2));
  }
}
